﻿/*  ----------------------------------------------------------------------------
 *  ITGROUP
 *  ----------------------------------------------------------------------------
 *  IBBA Infra Web
 *  ----------------------------------------------------------------------------
 *  File:       MenuUserControl.ascx.cs
 *  Author:     ITGROUP\eduardog
 *  ----------------------------------------------------------------------------
 */
using System.Collections.Generic;
using bba.framework.infraweb.entities;
using bba.framework.infraweb.interfaces.controller;
using Microsoft.Practices.Unity;
namespace ibba.src.noriskbo.Web.Controls
{
    /// <summary>
    /// Classe reponsável pelo(s) método(s), evento(s) e propriedade(s) do UserControl-MenuUser
    /// </summary>
    public partial class MenuUserControl : System.Web.UI.UserControl
    {
        [Dependency]
        public IMenuControlController MenuController { get; set; }

        #region Fields

        protected List<Alert> ListViewState
        {
            set { ViewState["listAlert"] = value; }
            get
            {
                object o = ViewState["listAlert"];
                if (o == null)
                    return null;
                else
                    return (List<Alert>)o;
            }
        }

        #endregion

        #region Events

        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                MenuController.LoadFavorites(this.CategoryRepeater);
                MenuController.LoadVisits(this.AcessFeatureRepeater);
                MenuController.PermissionAlert(this.newAlertImg, this);
                MenuController.LoadControlView(this.btnAlertas, this);
            }
        }

        #endregion

    }
}
